import request from '@/config/axios'

// 家庭 VO
export interface FamilyVO {
  id: number // 家庭唯一ID
  familyCode: string // 家庭邀请码
  familyName: string // 家庭名称
  status: number // 状态（0正常 1解散）
}

// 家庭 API
export const FamilyApi = {
  // 查询家庭分页
  getFamilyPage: async (params: any) => {
    return await request.get({ url: `/remind/family/page`, params })
  },

  // 查询家庭详情
  getFamily: async (id: number) => {
    return await request.get({ url: `/remind/family/get?id=` + id })
  },

  // 新增家庭
  createFamily: async (data: FamilyVO) => {
    return await request.post({ url: `/remind/family/create`, data })
  },

  // 修改家庭
  updateFamily: async (data: FamilyVO) => {
    return await request.put({ url: `/remind/family/update`, data })
  },

  // 删除家庭
  deleteFamily: async (id: number) => {
    return await request.delete({ url: `/remind/family/delete?id=` + id })
  },

  // 导出家庭 Excel
  exportFamily: async (params) => {
    return await request.download({ url: `/remind/family/export-excel`, params })
  },

// 查询家庭下拉选项
getFamilyAllActiveList: async () => {
  return await request.get({ url: `/remind/family/list-simple` })
},
}
